Shading noise filter

ABSTRACT

A shading correction is employed for a scanner to correct shading distortion. However, an image corrected with the shading corrective curve has shading noise lines due to the effects of various factors in the producing process of the shading corrective curve. The characteristic of the shading noise is that the each value of any primary color channel, of each pixel in a line is higher or lower than of the adjacent two pixels in other lines, wherein a color channel is one of red, green, blue channel. Hence, the quality of the image is improved by removing the shading noise detected from the characteristic described above.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] This invention relates to a method of image editing, and more particularly to a method for correcting shading noise.

[0003] 2. Description of the Prior Art

[0004] In general, a scanning process of a scanner is: moving a light source and a scanning module along a scanning direction by means of a stepper motor. Then, the light source illuminates onto the material of demand and is reflected into the scanning module. An image is captured by a light sensor such as CCD (Charge-Coupled Device) and then translated into digital data to save.

[0005] The digital data of the image is different from the captured data with the light sensor, due to the light provided by the light source not an ideal linear light and the brightness varying along a direction of the arrangement of the light sensor. The brightness is approximately brighter in the center of the light than in the edge thereof, as shown in FIG. 1A. Therefore, the captured image is brighter in the center of the image than in the edge thereof due to a disproportionate brightness of the light source. In general, the brightness distribution of the light is pre-scanned and the captured data is efficiently corrected as the data with an ideal linear light by the pre-scanned data, as shown in FIG. 1A.

[0006] Furthermore, a light sensor is a plurality of CCDs arranged in a line and the data detected by different CCDs is different due to each CCD having a different light sensitivity. Moreover, external factors may vary with time, for example: the variant of light resulting from a supplying power varying with time, the variant in the light sensitivity of the CCD with time, etc. These factors are generally called “shading distortion”. Therefore, the data of the image is corrected for the elimination of the disproportionate distribution of the light, but the corrected data still has a problem of being uneven, resulting from the shading noise, as shown in FIG. 1B.

[0007] The corrective method of the shading distortion is that the scanner pre-scans a reference white (a white corrective board) or a reference black (covering with the light sensor before capturing image). The data of the reference white or the reference black is the shading distortion corrective curve. Hence, a captured image can be corrected within the corrective curve for obtaining a more corrective image data.

[0008] Nevertheless, the shading distortion corrective curve has local maximums or local minimums resulting from the noise of the electrical devices, bad CCDs, or inexact deductive methods. The local maximums or minimums resulting from random noise do not appear every time. The inexact deductive method causes the data to wrong correcting. These results are generally called “shading noise”. If the image data is corrected by the corrective curve comprising shading noise, the corrected image has some shading noise lines. The shading noise lines in the corrected image are caused by the shading corrective curve being one dimensional and the shading noise appears in same position as the lines in a two-dimensional image.

[0009] Hence, the shading corrective curve in the conventional arts can correct the problem of shading distortion, but they easily generate problems with shading noise and reduce the quality of the image.

SUMMARY OF THE INVENTION

[0010] The conventional arts mentioned above can correct the shading distortion, but generates the problem of the shading noise. In accordance with the present invention, a method for correcting the shading noise can efficiently improve the problem of the shading noise result from the correction of the shading distortion.

[0011] It is another object of this invention to employ the method for correcting the shading noise to correct the shading noise for increasing the image quality.

[0012] In accordance with the above-mentioned objects, the present invention provides a method for correcting the shading noise. In the present invention, it detects the shading noise by means of characteristics of the shading noise, and eliminates the shading noise for an increased image quality.

BRIEF DESCRIPTION OF THE DRAWINGS

[0013]FIG. 1A is a diagram of the disproportionate brightness in a general scanner;

[0014]FIG. 1B is a diagram of an image with uneven brightness result from shading noises;

[0015]FIG. 2 is a flow chart of eliminating shading noises; and

[0016]FIG. 3 is a flow chart of mathematical calculation of a shading noise function.

[0017]FIG. 4A to FIG. 4B is a flow chart of mathematical calculation of a shading noise function.

DESCRIPTION OF THE PREFERRED EMBODIMENT

[0018] Some sample embodiments of the invention will now be described in greater detail. Nevertheless, it should be recognized that the present invention can be practiced in a wide range of other embodiments besides those explicitly described, and the scope of the present invention is expressly not limited expect as specified in the accompanying claims.

[0019] The process of obtaining the shading distortion corrective curve measures with three primary colors RGB (red, green, and blue), respectively. Therefore, the characteristic of the shading noise is a line of one pixel width with one certain primary color in an image. The primary values in the pixels of the lines are lower or higher, than one percent of the color values of the primary color, within the two adjacent pixels in the adjacent lines. Therefore, the shading noise of an image can be detected and eliminated by means of the characteristic of the shading noise. The steps of eliminating shading noise are: start, detecting shading noise, eliminating shading noise, and end, as shown in FIG. 2. The characteristic is that one certain color value of the primary color of the pixels with shading noise is higher or lower than the color value of the same primary color of two adjacent pixels. Hence, the detecting function is:

X(i)>Max[X(i−1),X(i+1)] or

X(i)<Min[X(i−1),X(i+1)]  (1)

[0020] wherein X(n) is the nth color value of one certain primary color.

[0021] Eq.(1) can be rewritten:

[X(i−1)−X(i)][X(i)−X(i+1)]<0  (2)

[0022] If the i^(th) pixel of the corrective curve has a shading noise in one certain primary color, the image of two-dimension M×N corrected with the corrective line has a shading noise line ((i,j), j=1 to N). Therefore, Eq. (2) in one-dimension can be rewritten to translate into Eq. (3) in two-dimension:

[X(i−1,j)−X(i,j)][X(i,j)−X(i+1,j)]<0  (3)

[0023] wherein x(i,j) is a color value of one certain primary color and 1 is one certain value among 1 to M′ j=1

N.

[0024] If the Eq. (3) is true during j=1 to N, the line of (i,j: j=1 to N) is a shading noise line. The primary color values with shading noise of the i^(th) line transforms into the average of two adjacent same primary color values in adjacent lines for correcting the shading noise.

Xn(i,j)=[X(i−1,j)+X(i+1,j)]/2  (4)

[0025] wherein the Xn(i,j) is a new corrected color value of (i,j) and j is 1 to N.

[0026] If the Eq. (3) is not true during j=1 to N, the line of (i,j: j=1 to N) is not a shading noise line and the color value in the line is not corrected.

Xn(i,j)=X(i,j)  (5)

[0027] wherein j is 1 to N.

[0028] Referring to FIG. 3, it is a flow chart of mathematical calculation of a shading noise function. Wherein, the block 20 a to 20 f is the detecting step; the block 22 is the correcting step; and the block 24 is the not correcting step.

[0029] Regarding an image with the color or brightness greatly varying, the variant of the color or brightness may be larger than the variant of the shading noise. Therefore, Eq. (3) may be not true during j=1 to N. Accordingly, if more than one certain percent (e.g. 80%) thereof during j=1 to N is true, the color value may be corrected with Eq. (4). The value of the one certain percent can be determined according to different conditions. Referring to FIG. 4A and FIG. 4B, compared with FIG. 3B, the block 26, block 28 a-28 f, and block 30 are added. The block 26 is setting counter to 0; the block 28 a-28 f is adding 1 to counter; and the block 30 is detecting a ratio of the counter value and N. If the ratio is bigger than a predetermined ratio and then proceed with the block 22; if not and then proceed with the block 24.

[0030] Although the present invention has been described in its preferred embodiment, it is not intended to limit the invention to the precise embodiment disclosed herein. Those who are skilled in this technology can still make various alterations and modifications without departing from the scope and spirit of this invention. Therefore, the scope of the present invention shall be defined and protected by the following claims and their equivalents. 

What is claimed is:
 1. A method for eliminating shading noise, comprising: detecting a shading noise in an image and determining a plurality of shading noise lines; and eliminating said shading noise from said a plurality of shading noise lines in said image.
 2. The method for eliminating shading noise according to claim 1, wherein said shading noise is detecting by means of a characteristic of said shading noise.
 3. The method for eliminating shading noise according to claim 2, wherein said characteristic is a line with one pixel width and at least one color value of one color in said shading noise line is higher than adjacent two pixels in adjacent lines.
 4. The method for eliminating shading noise according to claim 2, wherein said characteristic is a line with one pixel width and at least one color value of one color in said shading noise line is higher a certain percent than adjacent two pixels in adjacent lines.
 5. The method for eliminating shading noise according to claim 2, wherein said characteristic is a line with one pixel width and at least one color value of one color in said shading noise line is lower than adjacent two pixels in adjacent lines.
 6. The method for eliminating shading noise according to claim 2, wherein said characteristic is a line with one pixel width and at least one color value of one color in said shading noise line is lower a certain percent than adjacent two pixels in adjacent lines.
 7. The method for eliminating shading noise according to claim 2, wherein a detecting function of said shading noise is: [X(i−1,j)−X(i,j)][X(i,j)−X(i+1,j)]<0 wherein X(i,j) is one color value in a coordinate (i,j) of an image; X(i−1,j) and X(i+1,j) are color values of same said color.
 8. The method for eliminating shading noise according to claim 7, wherein a line in said image has shading noise if the detecting result of said detecting function are true over a certain percent.
 9. The method for eliminating shading noise according to claim 8, wherein said certain percent is 80 percent.
 10. The method for eliminating shading noise according to claim 3, wherein said color value further comprises one of red, green, and blue.
 11. The method for eliminating shading noise according to claim 4, wherein said color value is one of red, green, and blue.
 12. The method for eliminating shading noise according to claim 2, wherein said shading noises are detected by means of a product of a difference between a color value of one of adjacent pixels and said color value and a difference between the other color value of one of adjacent pixels and said color value.
 13. The method for eliminating shading noise according to claim 1, wherein a new color value is a average of said adjacent color values for eliminating said shading noise.
 14. The method for eliminating shading noise according to claim 1, wherein said color value is not transformed if detecting shading noise is false.
 15. A method for eliminating shading noises, comprising: detecting a shading noise in an image by means of a product of a difference between color values of one of adjacent pixels and color values of and a difference between the other color value of one of adjacent pixels and said color value and determining a plurality of shading noise lines; and eliminating said shading noise from said a plurality of shading noise lines in said image.
 16. The method for eliminating shading noise according to claim 15, wherein a detecting function of said shading noise is: [X(i−1,j)−X(i,j)][X(i,j)−X(i+1,j)]<0 wherein X(i,j) is one color value in a coordinate (i,j) of an image; X(i−1,j) and X(i+1,j) are color values of same said color.
 17. The method for eliminating shading noise according to claim 16, wherein a line in said image has shading noise if the detecting result of said detecting function are true over a certain percent.
 18. The method for eliminating shading noise according to claim 17, wherein said certain percent is 80 percent.
 19. The method for eliminating shading noise according to claim 15, wherein a new color value is a average of said adjacent color values for eliminating said shading noise.
 20. The method for eliminating shading noise according to claim 15, wherein said color value is not transformed if detecting shading noise is false. 